<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="/bigjo/js/jquery.js"></script>
<title>Insert title here</title>
</head>
<style type="text/css">
	#sbInsert{
		text-align: center;
		margin-left: 507px;
		margin-top: 50px;
	}
	
	.sbinarea{
		width: 300px;
		height: 100px;
	}
	textarea{
		resize:none;
	}
</style>

<script type="text/javascript">
	jQuery.noConflict();
	jQuery("#submit").click(function(){
		var idx = document.URL.indexOf("bigjo");
		var str = document.URL.substring(0,idx+5);
		var s_no = jQuery(".s_no").attr("id");
		var id = jQuery(".s_no").attr("m_id");
		var title = jQuery(".sbtitle").val();
		var context = jQuery(".sbinarea").val();
		if(title == ""){
			alert("제목을 입력하세요");
			return;
		}
		else if(context == ""){
			alert("내용을 입력하세요");
			return;
		}
		else{
			if (confirm("작성 하시겠습니까??") == true){    //확인
				document.location.href = str + "/sBoardInsert.singer?s_no="+s_no+"&title="+title+"&context="+context+"&m_id="+id;
			}else{   //취소
			return;
			}
		}
	});
	jQuery.noConflict();
	jQuery("#return").click(function(){
		var idx = document.URL.indexOf("bigjo");
		var str = document.URL.substring(0,idx+5);
		var s_no = jQuery(".s_no").attr("id");
		if (confirm("작성 하시겠습니까??") == true){    //확인
			document.location.href = str + "/singerBoard.singer?page="+s_no+"&sb_s_no="+s_no;
			alert("간다");
		}else{   //취소
		return;
		}
		
	});
	
</script>

<body>
	<div id="sbInsert">
		<table>
			<tr>
				<td><label id="${s_no}" m_id="${m_id}" class="s_no">아이디:</label></td><td><label>${m_id}</label></td>
			</tr>
			<tr>
				<td><label>제 목 :</label></td><td><input type="text" class="sbtitle" value=""></td>
			</tr>
			<tr>
				<td>내 용 :</td><td><textarea class="sbinarea"></textarea></td>
			</tr>
			<tr>
				<td colspan="2"><input type="button" id="submit" value="등록"><input type="button" id="return" value="취소"></td>
			</tr>
		</table>
	</div>
</body>
</html>